<template>
  <div class="header">
    <router-link to="/">
      <div class="iconfont">&#xe624;</div>
    </router-link>
    <div class="countrychoose">
      <span class="left" @click="chooseleft">境内 </span>
      <span class="right" @click="chooseright">境外</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "cityHeader",
  methods: {
    chooseleft(e) {
      let right = document.querySelector(".right");
      right.style.background = "#00bcd4";
      right.style.color = "#fff";
      e.target.style.background = "#fff";
      e.target.style.color = "#00bcd4";
    },
    chooseright(e) {
      let left = document.querySelector(".left");
      left.style.background = "#00bcd4";
      left.style.color = "#fff";
      e.target.style.background = "#fff";
      e.target.style.color = "#00bcd4";
    },
  },
};
</script>

<style lang='stylus' scoped>
@font-face {
  font-family: 'iconfont';
  src: url('~@/assets/style/iconfont/iconfont.woff2?t=1636704678087') format('woff2'), url('~@/assets/style/iconfont/iconfont.woff?t=1636704678087') format('woff'), url('~@/assets/style/iconfont/iconfont.ttf?t=1636704678087') format('truetype');
}

.header {
  overflow: hidden;
  height: 0.86rem;
  line-height: 0.86rem;
  text-align: center;
  color: #fff;
  background: #00bcd4;
  position: relative;

  .iconfont {
    font-family: 'iconfont' !important;
    font-size: 16px;
    font-style: normal;
    position: absolute;
    left: 0;
    top: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 0.64rem;
    color: #fff;
  }

  .countrychoose {
    display: flex;
    height: 0.86rem;
    line-height: 0.86rem;
    justify-content: center;

    .left {
      width: 2rem;
      margin-bottom: 0.1rem;
      margin-top: 0.1rem;
      line-height: 0.66rem;
      height: 0.66rem;
      border-radius: 0.1rem;
    }

    .right {
      width: 2rem;
      margin-bottom: 0.1rem;
      margin-top: 0.1rem;
      line-height: 0.66rem;
      height: 0.66rem;
      border-radius: 0.1rem;
    }
  }
}
</style>